/*
trainer_code.dm
All of the stuff that trainers do can be found here.
*/

mob/npc/trainer
	var/flavor_text
	var/pre_req_class
	New()
		..()
		name = "[class] Trainer"

	LeftClick(mob/player/caller, location, control, params)
		if(get_dist(caller,src)>1 || caller.client.busy)return
		caller.client.busy=TRUE
		caller.canMove=FALSE

		if(caller.class == class)
			caller << flavor_text
			return

		if(!caller.classlvl[pre_req_class])
			caller << "You are not experienced enough for my training."
			return

		if(alert(caller, "Would you like to change your class to [class]?", "[name]", "Yes","No")=="Yes")

			caller << "You are now a [class]! Welcome to the brotherhood!"

			if(!caller.classlvl[class]) caller.classlvl[class]=1

			if(!(class in caller.classexp))caller.classexp[class]=0
			if(!(class in caller.classmexp))caller.classmexp[class]=100

			caller.class=class

			caller.change_class()

		caller.client.busy=FALSE
		caller.canMove=TRUE
